/*
 * XML Type:  XAdaptor
 * Namespace: http://www.seedwill.com/xul/core
 * Java type: com.seedwill.xul.core.XAdaptor
 *
 * Automatically generated - do not modify.
 */
package com.seedwill.xul.core.impl;
/**
 * An XML XAdaptor(@http://www.seedwill.com/xul/core).
 *
 * This is a complex type.
 */
public class XAdaptorImpl extends com.seedwill.xul.core.impl.XIdentifiedImpl implements com.seedwill.xul.core.XAdaptor
{
    private static final long serialVersionUID = 1L;
    
    public XAdaptorImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName TYPE$0 = 
        new javax.xml.namespace.QName("", "type");
    private static final javax.xml.namespace.QName PIN$2 = 
        new javax.xml.namespace.QName("", "pin");
    private static final javax.xml.namespace.QName POUT$4 = 
        new javax.xml.namespace.QName("", "pout");
    
    
    /**
     * Gets the "type" element
     */
    public java.lang.String getType()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(TYPE$0, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "type" element
     */
    public org.apache.xmlbeans.XmlString xgetType()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(TYPE$0, 0);
            return target;
        }
    }
    
    /**
     * Sets the "type" element
     */
    public void setType(java.lang.String type)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(TYPE$0, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(TYPE$0);
            }
            target.setStringValue(type);
        }
    }
    
    /**
     * Sets (as xml) the "type" element
     */
    public void xsetType(org.apache.xmlbeans.XmlString type)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(TYPE$0, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(TYPE$0);
            }
            target.set(type);
        }
    }
    
    /**
     * Gets array of all "pin" elements
     */
    public org.apache.xmlbeans.XmlAnySimpleType[] getPinArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(PIN$2, targetList);
            org.apache.xmlbeans.XmlAnySimpleType[] result = new org.apache.xmlbeans.XmlAnySimpleType[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "pin" element
     */
    public org.apache.xmlbeans.XmlAnySimpleType getPinArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlAnySimpleType target = null;
            target = (org.apache.xmlbeans.XmlAnySimpleType)get_store().find_element_user(PIN$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "pin" element
     */
    public int sizeOfPinArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(PIN$2);
        }
    }
    
    /**
     * Sets array of all "pin" element
     */
    public void setPinArray(org.apache.xmlbeans.XmlAnySimpleType[] pinArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(pinArray, PIN$2);
        }
    }
    
    /**
     * Sets ith "pin" element
     */
    public void setPinArray(int i, org.apache.xmlbeans.XmlAnySimpleType pin)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlAnySimpleType target = null;
            target = (org.apache.xmlbeans.XmlAnySimpleType)get_store().find_element_user(PIN$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(pin);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "pin" element
     */
    public org.apache.xmlbeans.XmlAnySimpleType insertNewPin(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlAnySimpleType target = null;
            target = (org.apache.xmlbeans.XmlAnySimpleType)get_store().insert_element_user(PIN$2, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "pin" element
     */
    public org.apache.xmlbeans.XmlAnySimpleType addNewPin()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlAnySimpleType target = null;
            target = (org.apache.xmlbeans.XmlAnySimpleType)get_store().add_element_user(PIN$2);
            return target;
        }
    }
    
    /**
     * Removes the ith "pin" element
     */
    public void removePin(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(PIN$2, i);
        }
    }
    
    /**
     * Gets array of all "pout" elements
     */
    public org.apache.xmlbeans.XmlAnySimpleType[] getPoutArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(POUT$4, targetList);
            org.apache.xmlbeans.XmlAnySimpleType[] result = new org.apache.xmlbeans.XmlAnySimpleType[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "pout" element
     */
    public org.apache.xmlbeans.XmlAnySimpleType getPoutArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlAnySimpleType target = null;
            target = (org.apache.xmlbeans.XmlAnySimpleType)get_store().find_element_user(POUT$4, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "pout" element
     */
    public int sizeOfPoutArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(POUT$4);
        }
    }
    
    /**
     * Sets array of all "pout" element
     */
    public void setPoutArray(org.apache.xmlbeans.XmlAnySimpleType[] poutArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(poutArray, POUT$4);
        }
    }
    
    /**
     * Sets ith "pout" element
     */
    public void setPoutArray(int i, org.apache.xmlbeans.XmlAnySimpleType pout)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlAnySimpleType target = null;
            target = (org.apache.xmlbeans.XmlAnySimpleType)get_store().find_element_user(POUT$4, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(pout);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "pout" element
     */
    public org.apache.xmlbeans.XmlAnySimpleType insertNewPout(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlAnySimpleType target = null;
            target = (org.apache.xmlbeans.XmlAnySimpleType)get_store().insert_element_user(POUT$4, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "pout" element
     */
    public org.apache.xmlbeans.XmlAnySimpleType addNewPout()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlAnySimpleType target = null;
            target = (org.apache.xmlbeans.XmlAnySimpleType)get_store().add_element_user(POUT$4);
            return target;
        }
    }
    
    /**
     * Removes the ith "pout" element
     */
    public void removePout(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(POUT$4, i);
        }
    }
}
